package patterns.dao;

/**
 * Created by lenovo on 2016/12/12 0012.
 * 演示
 */
public class DAOPatternDemo {
    public static  void main(String[] args){
        IStudentDao studentDao = new StudentDaoImple();
        //显示所有
        for (Student student:studentDao.getAllStudents()){
            System.out.println("Student：[RollNo: "+student.getRollNo() + " name: "+student.getName());
        }
        //更新
        Student s = studentDao.getStudent(0);
        s.setName("Marry");
        studentDao.updateStudent(s);

        //获取指定编号的对象数据
        System.out.println(studentDao.getStudent(0).toString());

    }
}
